package git.soulbgm.common.session;

import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.UnknownSessionException;
import org.apache.shiro.session.mgt.eis.AbstractSessionDAO;
import org.apache.shiro.session.mgt.eis.CachingSessionDAO;
import org.apache.shiro.session.mgt.eis.SessionIdGenerator;

import java.io.Serializable;
import java.util.Collection;

/**
 * @author SoulBGM
 * @version 1.0
 * @date 2019/10/16 16:35
 */
public class RedisSessionDAO extends CachingSessionDAO {

    public RedisSessionDAO(CacheManager cacheManager) {
        setCacheManager(cacheManager);
    }

    @Override
    protected Serializable doCreate(Session session) {
        Serializable sessionId = generateSessionId(session);
        assignSessionId(session, sessionId);
        return sessionId;
    }

    @Override
    protected void doUpdate(Session session) {

    }

    @Override
    protected void doDelete(Session session) {

    }

    @Override
    protected Session doReadSession(Serializable sessionId) {
        return null;
    }
}
